import pymysql
class DEBUTI():
    cnn=None
    @classmethod
    def cnnect(cls):
        if cls.cnn == None:
            cls.cnn = pymysql.connect(host="211.103.136.244", port=7061, user="student",
                                  password="iHRM_student_2021", database="test_db", charset="utf8")
        return cls.cnn
    @classmethod
    def close(cls):
        if cls.cnn is not None:
            cls.cnn.close()
            cls.cnn=None
    @classmethod
    def query(cls):
        cursor=None
        res=None
        cls.cnn=cls.cnnect()
        cursor=cls.cnn.cursor()
        cursor.execute("")
        res=cursor.fetchone()


    @classmethod
    def insert(cls):
        cursor=None
        cls.cnn=cls.cnnect()
        cursor=cls.cnn.cursor()
        cursor.execute("")
        cls.cnn.commit()
    @classmethod
    def updata(cls):
        cursor = None
        cls.cnn = cls.cnnect()
        cursor = cls.cnn.cursor()
        cursor.execute("")
        cls.cnn.commit()
    @classmethod
    def delte(cls):
        cursor = None
        cls.cnn = cls.cnnect()
        cursor = cls.cnn.cursor()
        cursor.execute("")
        cls.cnn.commit()
